package com.aiju.common;

import android.content.res.Resources;
import android.util.DisplayMetrics;

public enum PixValue {
	dp {
		@Override
		public int valueOf(float value) {
			return (int) (value * m.density+ 0.5f);
		}
	},
	xp {
		@Override
		public int valueOf(float value) {
			return (int) (value / m.density + 0.5f);
		}
	};
	
	public static DisplayMetrics m = Resources.getSystem().getDisplayMetrics();
	
	public abstract int valueOf(float value);
}